var getObj=function(node){
	return document.getElementById(node);
}
function getObj(objId){
	return document.getElementById(objId);
}
document.onkeydown = function(e){
 if(!e) e = window.event;
 if((e.keyCode || e.which) == 13){
 document.getElementById("sub").click();
}
}
function inst() {
	document.body.addEventListener("touchmove",function(event){
	    event.preventDefault();
	    event.stopPropagation();
	}, false);
	// if (getObj("name")!=null) getObj("name").value = getObj("tishi1").innerHTML;
	/*
	if (getObj("code")!=null) getObj("code").value = getObj("tishi4").innerHTML;
	var objSelect = getObj("time");
	var ips = objSelect.options.length;
	if (ips=="1"){
		getObj("s10").style.display = "none";
	}
    */
}

function preview() { 
	bdhtml=window.document.body.innerHTML; 
	sprnstr="<!--startprint-->"; 
	eprnstr="<!--endprint-->"; 
	prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); 
	prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); 
	window.document.body.innerHTML=prnhtml; 
	window.print(); 
} 

function st(ids,Num){
	if (getObj(ids).value == getObj("tishi"+Num).innerHTML){
		getObj(ids).value = "";
	}
}

function startRequest(Num) {
	var queryString;
	if(Num == 1 || Num == 0){
	if(getObj("time").value == ""){
	getObj('time').style.borderColor='red';
	return false;
	}else{
	getObj('time').style.borderColor='green';
	}
	}
	if(Num == 2 || Num == 0){
	if(getObj("name").value == "" || getObj("name").value == getObj("tishi1").innerHTML){
	getObj("name").value = getObj("tishi1").innerHTML;
	getObj('s11').style.borderColor='red';
	return false;
	}else{
	getObj('s11').style.borderColor='green';
	}
	}
	if(Num == 3 || Num == 0){
	if (getObj("code")!=null){
	if (!getObj("code").value.match(/^[0-9]{4}$/)){
	getObj("code").value = getObj("tishi4").innerHTML;
	getObj('s33').style.borderColor='red';
	return false;
	}else{
	getObj('s33').style.borderColor='green';
	}
	}
	}
	if(Num == "0"){
	}
}